<?php
	/**
	 * IM通知游戏绑定了手机
	 */
    class BecomeRegular extends APIBase {
		
		public $tag = "BecomeRegular";
    	public $isLogin = false;
		
		public function before() {
			$this->initCacheRedis();
			$this->initMysql();
			return true;
		}
		public function logic() {
			if(!isset($this->param['passport']) && $this->param['passport']==''){
				$this->returnError(301,'passport is must need!');
			}
			$passport = $this->param['passport'];
			$row = $this->mysql->select("player", "*", array('passport' => $passport));
		    $c = count($row);
			if($c == 0){
				$this->returnError(301,'参数错误,此玩家不存在');
			}
			
			$uid = $row[0]['id'];
			$this->data_redis->hMset("hu:{$uid}", array('is_visitor'=>0));
			$this->returnData(0);
			

		}
		
        public function after() {
			$this->deinitCacheRedis();
		}
    }
?>
